import filedict
import os


def checkfile(fn):
	d = filedict.FileDict("dictionaries/"+fn)
	print fn,len(d)
	if len(d)<5:
		for k,v in d.iteritems():
			print k,'->',v
	d_copy = filedict.FileDict("dict_backup/"+fn)
	with d_copy.batch as fd:
		for k,v in d.iteritems():
			fd[k]=v

files = os.listdir("dictionaries/")
for f in files:
	checkfile(f)



